"""
@Author:WKVugen
@Time:2023-06-29
@Description:
"""
import time

from selenium.webdriver.common.by import By

from base.base_page import BasePage
from pageobject.login_page import LoginPage


class DelDemandPage(BasePage):

    # 页面元素
    supplier_demand_loc = (By.XPATH, "//span[text()='供应商招募管理']")
    demand_manage_loc = (By.XPATH, "//span[text()='招募需求管理']")
    del_button_02_loc = (By.XPATH,
                         "//*[@id='app']/div/div[2]/section/div/div[3]/div/div[1]/div[4]/div[2]/table/tbody/tr[2]/td[10]/div/button[3]")
    true_button_loc = (By.XPATH, "//button[@class='el-button el-button--default el-button--small el-button--primary ']")
    # 页面动作
    def del_demand(self):
        # 登陆
        lg = LoginPage(self.driver)
        lg.login_demand()
        self.click(DelDemandPage.supplier_demand_loc)
        time.sleep(1)
        self.click(DelDemandPage.demand_manage_loc)
        time.sleep(2)
        self.click(DelDemandPage.del_button_02_loc)
        time.sleep(2)
        self.click(DelDemandPage.true_button_loc)